home *** CD-ROM | disk | FTP | other *** search
/ This Disc Bytes! / Power Computing - The Disc 2 - This Disc Bytes.ISO / mac / CodeWarrior 7 Lite for 68K / MacOS Support / Headers / Universal Headers / Windows.h < prev    next >
Text File  |  1995-07-06  |  21KB  |  527 lines

  1. /*
  2.      File:        Windows.h
  3.  
  4.      Contains:    Window Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __WINDOWS__
  21. #define __WINDOWS__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __MEMORY__
  30. #include <Memory.h>
  31. #endif
  32. /*    #include <MixedMode.h>                                        */
  33.  
  34. #ifndef __QUICKDRAW__
  35. #include <Quickdraw.h>
  36. #endif
  37. /*    #include <QuickdrawText.h>                                    */
  38.  
  39. #ifndef __EVENTS__
  40. #include <Events.h>
  41. #endif
  42. /*    #include <OSUtils.h>                                        */
  43.  
  44. #ifndef __CONTROLS__
  45. #include <Controls.h>
  46. #endif
  47. /*    #include <Menus.h>                                            */
  48.  
  49. #ifdef __cplusplus
  50. extern "C" {
  51. #endif
  52.  
  53. #if PRAGMA_ALIGN_SUPPORTED
  54. #pragma options align=mac68k
  55. #endif
  56.  
  57. #if PRAGMA_IMPORT_SUPPORTED
  58. #pragma import on
  59. #endif
  60.  
  61. /*####################################################################################
  62.  
  63.      Window Accessors
  64.  
  65.     Use these with or without STRICT_WINDOWS and your source will more easily migrate
  66.     to being Copland-savvy.  When STRICT_WINDOWS is set to true, the WindowRecord and
  67.     WindowPeek are no longer defined.  This will allow you to, from a source code level, 
  68.     remove all direct accesses to Window Manager data structures.  
  69.  
  70.     These accessors will be available as true API entrypoints in Copland, but are not
  71.     guaranteed to match exactly.  Specifically, GetNextWindow will not be supported and
  72.     a whole new model for iterating the window list will be presented.  Using GetNextWindow
  73.     for now is ok, however, as it will let you leverage the STRICT flags.
  74.  
  75.     If you don't see an accessor for a field you need, there's probably a very good
  76.     reason.  Needing access to fields for which there is no accessor is a good indicator
  77.     of behavior that is not Copland-savvy.  Such behavior does not necessarily make your 
  78.     code incompatible, but it likely something we are trying to discourage as we evolve
  79.     the toolbox into a more robust and useful service.
  80.  
  81.     Please direct all questions regarding usage to the TOOLBOX AppleLink address.
  82.  
  83.      <<<< See Controls.h for access to the window's control list >>>>
  84.  
  85. #####################################################################################*/
  86. #ifdef __cplusplus
  87. inline CGrafPtr    GetWindowPort(WindowRef w)                     { return (CGrafPtr) w;                                                     }
  88. inline void        SetPortWindowPort(WindowRef aWindowRef)        {    SetPort( (GrafPtr) GetWindowPort(aWindowRef)); }
  89. inline SInt16        GetWindowKind(WindowRef w)                     { return ( *(SInt16 *)    (((UInt8 *) w) + sizeof(GrafPort)));             }
  90. inline void        SetWindowKind(WindowRef    w, SInt16 wKind)    {  *(SInt16 *)    (((UInt8 *) w) + sizeof(GrafPort)) = wKind;              }
  91. inline    Boolean        IsWindowVisible(WindowRef w)                { return *(Boolean *)    (((UInt8 *) w) + sizeof(GrafPort) + 0x2);         }
  92. inline Boolean        IsWindowHilited(WindowRef w)                { return *(Boolean *)    (((UInt8 *) w) + sizeof(GrafPort) + 0x3);        }
  93. inline Boolean        GetWindowGoAwayFlag(WindowRef w)            { return *(Boolean *)    (((UInt8 *) w) + sizeof(GrafPort) + 0x4);        }
  94. inline Boolean        GetWindowZoomFlag(WindowRef w)                { return *(Boolean *)    (((UInt8 *) w) + sizeof(GrafPort) + 0x5);        }
  95. inline void        GetWindowStructureRgn(WindowRef w, RgnHandle r)    {    CopyRgn( *(RgnHandle *)(((UInt8 *) w) + sizeof(GrafPort) + 0x6), r );    }
  96. inline void        GetWindowContentRgn(WindowRef w, RgnHandle r)    {    CopyRgn( *(RgnHandle *)(((UInt8 *) w) + sizeof(GrafPort) + 0xA), r );    }
  97. inline void        GetWindowUpdateRgn(WindowRef w, RgnHandle r)    {    CopyRgn( *(RgnHandle *)(((UInt8 *) w) + sizeof(GrafPort) + 0xE), r );    }
  98. inline SInt16        GetWindowTitleWidth(WindowRef w)                { return *(SInt16 *)(((UInt8 *) w) + sizeof(GrafPort) + 0x1E);            }
  99. inline WindowRef    GetNextWindow(WindowRef w)                        { return *(WindowRef *)    (((UInt8 *) w) + sizeof(GrafPort) + 0x24);        }
  100. inline void    GetWindowStandardState(WindowRef w, Rect *r)  {    Rect *stateRects = (  (Rect *) (**(Handle *) (((UInt8 *) w) + sizeof(GrafPort) + 0x16)));    if (stateRects != NULL)    *r = stateRects[1];        }
  101. inline void    SetWindowStandardState(WindowRef w, const Rect *r)    {     Rect *stateRects = (  (Rect *) (**(Handle *) (((UInt8 *) w) + sizeof(GrafPort) + 0x16))); if (stateRects != NULL)    stateRects[1] = *r;     }
  102. inline void    GetWindowUserState(WindowRef w, Rect *r)    {     Rect *stateRects = (  (Rect *) (**(Handle *) (((UInt8 *) w) + sizeof(GrafPort) + 0x16)));    if (stateRects != NULL)    *r = stateRects[0]; }
  103. inline void    SetWindowUserState(WindowRef w, const Rect *r)    { Rect *stateRects = (  (Rect *) (**(Handle *) (((UInt8 *) w) + sizeof(GrafPort) + 0x16)));    if (stateRects != NULL)    stateRects[0] = *r; }
  104. #else
  105. #define SetPortWindowPort(aWindowRef) SetPort( (GrafPtr) GetWindowPort(aWindowRef) )
  106. #define GetWindowPort(aWindowRef) ( (CGrafPtr) aWindowRef)
  107. #define GetWindowKind(aWindowRef) ( *(SInt16 *)    (((UInt8 *) aWindowRef) + sizeof(GrafPort)))
  108. #define SetWindowKind(aWindowRef, wKind) ( *(SInt16 *)    (((UInt8 *) aWindowRef) + sizeof(GrafPort)) = wKind )
  109. #define IsWindowVisible(aWindowRef) ( *(Boolean *)    (((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0x2))
  110. #define IsWindowHilited(aWindowRef) ( *(Boolean *)    (((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0x3))
  111. #define GetWindowGoAwayFlag(aWindowRef) ( *(Boolean *)    (((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0x4))
  112. #define GetWindowZoomFlag(aWindowRef) ( *(Boolean *)    (((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0x5))
  113. #define GetWindowStructureRgn(aWindowRef, aRgnHandle) CopyRgn( *(RgnHandle *)(((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0x6),  \
  114.     aRgnHandle )
  115. #define GetWindowContentRgn(aWindowRef, aRgnHandle) CopyRgn( *(RgnHandle *)(((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0xA),  \
  116.     aRgnHandle )
  117. #define GetWindowUpdateRgn(aWindowRef, aRgnHandle) CopyRgn( *(RgnHandle *)(((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0xE),  \
  118.     aRgnHandle )
  119. #define GetWindowTitleWidth(aWindowRef) ( *(SInt16 *)    (((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0x1E))
  120. #define GetNextWindow(aWindowRef) ( *(WindowRef *)    (((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0x24))
  121. #define GetWindowStandardState(aWindowRef, aRectPtr) do { Rect *stateRects = ( (Rect *) (**(Handle *) (((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0x16)));     \
  122.     if (stateRects != NULL)    *aRectPtr = stateRects[1]; } while (false);
  123. #define SetWindowStandardState(aWindowRef, aRectPtr) do { Rect *stateRects = ( (Rect *) (**(Handle *) (((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0x16)));     \
  124.     if (stateRects != NULL)    stateRects[1] = *aRectPtr; } while (false);
  125. #define GetWindowUserState(aWindowRef, aRectPtr) do { Rect *stateRects = ( (Rect *) (**(Handle *) (((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0x16)));     \
  126.     if (stateRects != NULL)    *aRectPtr = stateRects[0]; } while (false);
  127. #define SetWindowUserState(aWindowRef, aRectPtr) do { Rect *stateRects = ( (Rect *) (**(Handle *) (((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0x16)));     \
  128.     if (stateRects != NULL)    stateRects[0] = *aRectPtr; } while (false);
  129. #endif
  130.  
  131. enum {
  132.     kWindowDefProcType            = 'WDEF'
  133. };
  134.  
  135. /*####################################################################################*/
  136. /**/
  137. /*    Window Definition ID's*/
  138. /**/
  139. /*####################################################################################*/
  140. enum {
  141.     kStandardWindowDefinition    = 0,                            /* for document windows and dialogs*/
  142.     kRoundWindowDefinition        = 1,                            /* old da-style window*/
  143.     kFloatingWindowDefinition    = 124                            /* for floating windows*/
  144. };
  145.  
  146. /*####################################################################################*/
  147. /**/
  148. /* Window Variant Codes*/
  149. /**/
  150. /*####################################################################################*/
  151. enum {
  152. /* for use with kStandardWindowDefinition */
  153.     kModalDialogVariantCode        = 1,
  154.     kMovableModalDialogVariantCode = 5,
  155. /* for use with kFloatingWindowDefinition */
  156.     kSideFloaterVariantCode        = 8
  157. };
  158.  
  159. /*####################################################################################*/
  160. /**/
  161. /* Old-style procIDs.  For use only with New(C)Window*/
  162. /**/
  163. /*####################################################################################*/
  164. enum {
  165.     documentProc                = 0,
  166.     dBoxProc                    = 1,
  167.     plainDBox                    = 2,
  168.     altDBoxProc                    = 3,
  169.     noGrowDocProc                = 4,
  170.     movableDBoxProc                = 5,
  171.     zoomDocProc                    = 8,
  172.     zoomNoGrow                    = 12,
  173.     rDocProc                    = 16,
  174. /* floating window defproc ids */
  175.     floatProc                    = 1985,
  176.     floatGrowProc                = 1987,
  177.     floatZoomProc                = 1989,
  178.     floatZoomGrowProc            = 1991,
  179.     floatSideProc                = 1993,
  180.     floatSideGrowProc            = 1995,
  181.     floatSideZoomProc            = 1997,
  182.     floatSideZoomGrowProc        = 1999
  183. };
  184.  
  185. /*####################################################################################*/
  186. /**/
  187. /* Standard window kinds*/
  188. /**/
  189. /*####################################################################################*/
  190. enum {
  191.     dialogKind                    = 2,
  192.     userKind                    = 8,
  193.     kDialogWindowKind            = 2,
  194.     kApplicationWindowKind        = 8
  195. };
  196.  
  197. /*####################################################################################*/
  198. /**/
  199. /* FindWindow result codes*/
  200. /**/
  201. /*####################################################################################*/
  202. enum {
  203.     inDesk                        = 0,
  204.     inMenuBar                    = 1,
  205.     inSysWindow                    = 2,
  206.     inContent                    = 3,
  207.     inDrag                        = 4,
  208.     inGrow                        = 5,
  209.     inGoAway                    = 6,
  210.     inZoomIn                    = 7,
  211.     inZoomOut                    = 8
  212. };
  213.  
  214. enum {
  215.     wDraw                        = 0,
  216.     wHit                        = 1,
  217.     wCalcRgns                    = 2,
  218.     wNew                        = 3,
  219.     wDispose                    = 4,
  220.     wGrow                        = 5,
  221.     wDrawGIcon                    = 6
  222. };
  223.  
  224. enum {
  225.     deskPatID                    = 16
  226. };
  227.  
  228. /*####################################################################################*/
  229. /**/
  230. /* Window Definition hit test result codes ("WindowPart")*/
  231. /**/
  232. /*####################################################################################*/
  233. enum {
  234.     wNoHit                        = 0,
  235.     wInContent                    = 1,
  236.     wInDrag                        = 2,
  237.     wInGrow                        = 3,
  238.     wInGoAway                    = 4,
  239.     wInZoomIn                    = 5,
  240.     wInZoomOut                    = 6
  241. };
  242.  
  243. typedef pascal long (*WindowDefProcPtr)(short varCode, WindowRef theWindow, short message, long param);
  244. /*
  245.         DeskHookProcPtr uses register based parameters on the 68k and cannot
  246.         be written in or called from a high-level language without the help of
  247.         mixed mode or assembly glue.
  248.  
  249.             typedef pascal void (*DeskHookProcPtr)(Boolean mouseClick, EventRecord *theEvent);
  250.  
  251.         In:
  252.          => mouseClick      D0.B
  253.          => *theEvent       A0.L
  254. */
  255.  
  256. #if GENERATINGCFM
  257. typedef UniversalProcPtr WindowDefUPP;
  258. typedef UniversalProcPtr DeskHookUPP;
  259. #else
  260. typedef WindowDefProcPtr WindowDefUPP;
  261. typedef Register68kProcPtr DeskHookUPP;
  262. #endif
  263.  
  264. enum {
  265.     uppWindowDefProcInfo = kPascalStackBased
  266.          | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  267.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short)))
  268.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(WindowRef)))
  269.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short)))
  270.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long))),
  271.     uppDeskHookProcInfo = kRegisterBased
  272.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterD0, SIZE_CODE(sizeof(Boolean)))
  273.          | REGISTER_ROUTINE_PARAMETER(2, kRegisterA0, SIZE_CODE(sizeof(EventRecord*)))
  274. };
  275.  
  276. #if GENERATINGCFM
  277. #define NewWindowDefProc(userRoutine)        \
  278.         (WindowDefUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppWindowDefProcInfo, GetCurrentArchitecture())
  279. #define NewDeskHookProc(userRoutine)        \
  280.         (DeskHookUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDeskHookProcInfo, GetCurrentArchitecture())
  281. #else
  282. #define NewWindowDefProc(userRoutine)        \
  283.         ((WindowDefUPP) (userRoutine))
  284. #define NewDeskHookProc(userRoutine)        \
  285.         ((DeskHookUPP) (userRoutine))
  286. #endif
  287.  
  288. #if GENERATINGCFM
  289. #define CallWindowDefProc(userRoutine, varCode, theWindow, message, param)        \
  290.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppWindowDefProcInfo, (varCode), (theWindow), (message), (param))
  291. #define CallDeskHookProc(userRoutine, mouseClick, theEvent)        \
  292.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDeskHookProcInfo, (mouseClick), (theEvent))
  293. #else
  294. #define CallWindowDefProc(userRoutine, varCode, theWindow, message, param)        \
  295.         (*(userRoutine))((varCode), (theWindow), (message), (param))
  296. /* (*DeskHookProcPtr) cannot be called from a high-level language without the Mixed Mode Manager */
  297. #endif
  298.  
  299. extern pascal RgnHandle GetGrayRgn( void )
  300.     TWOWORDINLINE( 0x2EB8, 0x09EE ); /* MOVE.l $09EE,(SP) */
  301. /*####################################################################################*/
  302. /**/
  303. /*    Color table defined for compatibility only.  Will move to some ifdef'd wasteland.*/
  304. /**/
  305. /*####################################################################################*/
  306. struct WinCTab {
  307.     long                            wCSeed;                        /* reserved */
  308.     short                            wCReserved;                    /* reserved */
  309.     short                            ctSize;                        /* usually 4 for windows */
  310.     ColorSpec                        ctTable[5];
  311. };
  312. typedef struct WinCTab WinCTab;
  313.  
  314. typedef WinCTab *WCTabPtr, **WCTabHandle;
  315.  
  316. extern pascal void InitWindows(void)
  317.  ONEWORDINLINE(0xA912);
  318. extern pascal void GetWMgrPort(GrafPtr *wPort)
  319.  ONEWORDINLINE(0xA910);
  320. extern pascal WindowRef NewWindow(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short theProc, WindowRef behind, Boolean goAwayFlag, long refCon)
  321.  ONEWORDINLINE(0xA913);
  322. extern pascal WindowRef GetNewWindow(short windowID, void *wStorage, WindowRef behind)
  323.  ONEWORDINLINE(0xA9BD);
  324. extern pascal void CloseWindow(WindowRef theWindow)
  325.  ONEWORDINLINE(0xA92D);
  326. extern pascal void DisposeWindow(WindowRef theWindow)
  327.  ONEWORDINLINE(0xA914);
  328. extern pascal void GetWTitle(WindowRef theWindow, Str255 title)
  329.  ONEWORDINLINE(0xA919);
  330. extern pascal void SelectWindow(WindowRef theWindow)
  331.  ONEWORDINLINE(0xA91F);
  332. extern pascal void HideWindow(WindowRef theWindow)
  333.  ONEWORDINLINE(0xA916);
  334. extern pascal void ShowWindow(WindowRef theWindow)
  335.  ONEWORDINLINE(0xA915);
  336. extern pascal void ShowHide(WindowRef theWindow, Boolean showFlag)
  337.  ONEWORDINLINE(0xA908);
  338. extern pascal void HiliteWindow(WindowRef theWindow, Boolean fHilite)
  339.  ONEWORDINLINE(0xA91C);
  340. extern pascal void BringToFront(WindowRef theWindow)
  341.  ONEWORDINLINE(0xA920);
  342. extern pascal void SendBehind(WindowRef theWindow, WindowRef behindWindow)
  343.  ONEWORDINLINE(0xA921);
  344. extern pascal WindowRef FrontWindow(void)
  345.  ONEWORDINLINE(0xA924);
  346. extern pascal void DrawGrowIcon(WindowRef theWindow)
  347.  ONEWORDINLINE(0xA904);
  348. extern pascal void MoveWindow(WindowRef theWindow, short hGlobal, short vGlobal, Boolean front)
  349.  ONEWORDINLINE(0xA91B);
  350. extern pascal void SizeWindow(WindowRef theWindow, short w, short h, Boolean fUpdate)
  351.  ONEWORDINLINE(0xA91D);
  352. extern pascal void ZoomWindow(WindowRef theWindow, short partCode, Boolean front)
  353.  ONEWORDINLINE(0xA83A);
  354. extern pascal void InvalRect(const Rect *badRect)
  355.  ONEWORDINLINE(0xA928);
  356. extern pascal void InvalRgn(RgnHandle badRgn)
  357.  ONEWORDINLINE(0xA927);
  358. extern pascal void ValidRect(const Rect *goodRect)
  359.  ONEWORDINLINE(0xA92A);
  360. extern pascal void ValidRgn(RgnHandle goodRgn)
  361.  ONEWORDINLINE(0xA929);
  362. extern pascal void BeginUpdate(WindowRef theWindow)
  363.  ONEWORDINLINE(0xA922);
  364. extern pascal void EndUpdate(WindowRef theWindow)
  365.  ONEWORDINLINE(0xA923);
  366. extern pascal void SetWRefCon(WindowRef theWindow, long data)
  367.  ONEWORDINLINE(0xA918);
  368. extern pascal long GetWRefCon(WindowRef theWindow)
  369.  ONEWORDINLINE(0xA917);
  370. extern pascal void SetWindowPic(WindowRef theWindow, PicHandle pic)
  371.  ONEWORDINLINE(0xA92E);
  372. extern pascal PicHandle GetWindowPic(WindowRef theWindow)
  373.  ONEWORDINLINE(0xA92F);
  374. extern pascal Boolean CheckUpdate(EventRecord *theEvent)
  375.  ONEWORDINLINE(0xA911);
  376. extern pascal void ClipAbove(WindowRef window)
  377.  ONEWORDINLINE(0xA90B);
  378. extern pascal void SaveOld(WindowRef window)
  379.  ONEWORDINLINE(0xA90E);
  380. extern pascal void DrawNew(WindowRef window, Boolean update)
  381.  ONEWORDINLINE(0xA90F);
  382. extern pascal void PaintOne(WindowRef window, RgnHandle clobberedRgn)
  383.  ONEWORDINLINE(0xA90C);
  384. extern pascal void PaintBehind(WindowRef startWindow, RgnHandle clobberedRgn)
  385.  ONEWORDINLINE(0xA90D);
  386. extern pascal void CalcVis(WindowRef window)
  387.  ONEWORDINLINE(0xA909);
  388. extern pascal void CalcVisBehind(WindowRef startWindow, RgnHandle clobberedRgn)
  389.  ONEWORDINLINE(0xA90A);
  390. extern pascal long GrowWindow(WindowRef theWindow, Point startPt, const Rect *bBox)
  391.  ONEWORDINLINE(0xA92B);
  392. extern pascal short FindWindow(Point thePoint, WindowRef *theWindow)
  393.  ONEWORDINLINE(0xA92C);
  394. extern pascal long PinRect(const Rect *theRect, Point thePt)
  395.  ONEWORDINLINE(0xA94E);
  396. extern pascal long DragGrayRgn(RgnHandle theRgn, Point startPt, const Rect *limitRect, const Rect *slopRect, short axis, DragGrayRgnUPP actionProc)
  397.  ONEWORDINLINE(0xA905);
  398. extern pascal long DragTheRgn(RgnHandle theRgn, Point startPt, const Rect *limitRect, const Rect *slopRect, short axis, DragGrayRgnUPP actionProc)
  399.  ONEWORDINLINE(0xA926);
  400. extern pascal Boolean TrackBox(WindowRef theWindow, Point thePt, short partCode)
  401.  ONEWORDINLINE(0xA83B);
  402. extern pascal void GetCWMgrPort(CGrafPtr *wMgrCPort)
  403.  ONEWORDINLINE(0xAA48);
  404. extern pascal void SetWinColor(WindowRef theWindow, WCTabHandle newColorTable)
  405.  ONEWORDINLINE(0xAA41);
  406. extern pascal void SetDeskCPat(PixPatHandle deskPixPat)
  407.  ONEWORDINLINE(0xAA47);
  408. extern pascal WindowRef NewCWindow(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short procID, WindowRef behind, Boolean goAwayFlag, long refCon)
  409.  ONEWORDINLINE(0xAA45);
  410. extern pascal WindowRef GetNewCWindow(short windowID, void *wStorage, WindowRef behind)
  411.  ONEWORDINLINE(0xAA46);
  412. extern pascal short GetWVariant(WindowRef theWindow)
  413.  ONEWORDINLINE(0xA80A);
  414. extern pascal void SetWTitle(WindowRef theWindow, ConstStr255Param title)
  415.  ONEWORDINLINE(0xA91A);
  416. extern pascal Boolean TrackGoAway(WindowRef theWindow, Point thePt)
  417.  ONEWORDINLINE(0xA91E);
  418. extern pascal void DragWindow(WindowRef theWindow, Point startPt, const Rect *boundsRect)
  419.  ONEWORDINLINE(0xA925);
  420. #if CGLUESUPPORTED
  421. extern void setwtitle(WindowRef theWindow, const char *title);
  422. extern Boolean trackgoaway(WindowRef theWindow, Point *thePt);
  423. extern short findwindow(Point *thePoint, WindowRef *theWindow);
  424. extern void getwtitle(WindowRef theWindow, char *title);
  425. extern long growwindow(WindowRef theWindow, Point *startPt, const Rect *bBox);
  426. extern WindowRef newwindow(void *wStorage, const Rect *boundsRect, const char *title, Boolean visible, short theProc, WindowRef behind, Boolean goAwayFlag, long refCon);
  427. extern WindowRef newcwindow(void *wStorage, const Rect *boundsRect, const char *title, Boolean visible, short procID, WindowRef behind, Boolean goAwayFlag, long refCon);
  428. extern long pinrect(const Rect *theRect, Point *thePt);
  429. extern Boolean trackbox(WindowRef theWindow, Point *thePt, short partCode);
  430. extern long draggrayrgn(RgnHandle theRgn, Point *startPt, const Rect *boundsRect, const Rect *slopRect, short axis, DragGrayRgnUPP actionProc);
  431. extern void dragwindow(WindowRef theWindow, Point *startPt, const Rect *boundsRect);
  432. #endif
  433. #if !STRICT_WINDOWS
  434. typedef struct WindowRecord WindowRecord;
  435.  
  436. typedef WindowRecord *WindowPeek;
  437.  
  438. struct WindowRecord {
  439.     GrafPort                        port;
  440.     short                            windowKind;
  441.     Boolean                            visible;
  442.     Boolean                            hilited;
  443.     Boolean                            goAwayFlag;
  444.     Boolean                            spareFlag;
  445.     RgnHandle                        strucRgn;
  446.     RgnHandle                        contRgn;
  447.     RgnHandle                        updateRgn;
  448.     Handle                            windowDefProc;
  449.     Handle                            dataHandle;
  450.     StringHandle                    titleHandle;
  451.     short                            titleWidth;
  452.     ControlRef                        controlList;
  453.     WindowPeek                        nextWindow;
  454.     PicHandle                        windowPic;
  455.     long                            refCon;
  456. };
  457. typedef struct CWindowRecord CWindowRecord;
  458.  
  459. typedef CWindowRecord *CWindowPeek;
  460.  
  461. struct CWindowRecord {
  462.     CGrafPort                        port;
  463.     short                            windowKind;
  464.     Boolean                            visible;
  465.     Boolean                            hilited;
  466.     Boolean                            goAwayFlag;
  467.     Boolean                            spareFlag;
  468.     RgnHandle                        strucRgn;
  469.     RgnHandle                        contRgn;
  470.     RgnHandle                        updateRgn;
  471.     Handle                            windowDefProc;
  472.     Handle                            dataHandle;
  473.     StringHandle                    titleHandle;
  474.     short                            titleWidth;
  475.     ControlRef                        controlList;
  476.     CWindowPeek                        nextWindow;
  477.     PicHandle                        windowPic;
  478.     long                            refCon;
  479. };
  480. struct WStateData {
  481.     Rect                            userState;                    /*user state*/
  482.     Rect                            stdState;                    /*standard state*/
  483. };
  484. typedef struct WStateData WStateData;
  485.  
  486. typedef WStateData *WStateDataPtr, **WStateDataHandle;
  487.  
  488. typedef struct AuxWinRec AuxWinRec;
  489.  
  490. typedef AuxWinRec *AuxWinPtr, **AuxWinHandle;
  491.  
  492. struct AuxWinRec {
  493.     AuxWinHandle                    awNext;                        /*handle to next AuxWinRec*/
  494.     WindowRef                        awOwner;                    /*ptr to window */
  495.     CTabHandle                        awCTable;                    /*color table for this window*/
  496.     UInt32                            reserved;                    /*  */
  497.     long                            awFlags;                    /*reserved for expansion*/
  498.     CTabHandle                        awReserved;                    /*reserved for expansion*/
  499.     long                            awRefCon;                    /*user Constant*/
  500. };
  501. extern pascal Boolean GetAuxWin(WindowRef theWindow, AuxWinHandle *awHndl)
  502.  ONEWORDINLINE(0xAA42);
  503.  
  504. enum {
  505.     wContentColor                = 0,
  506.     wFrameColor                    = 1,
  507.     wTextColor                    = 2,
  508.     wHiliteColor                = 3,
  509.     wTitleBarColor                = 4
  510. };
  511.  
  512. #endif
  513.  
  514. #if PRAGMA_IMPORT_SUPPORTED
  515. #pragma import off
  516. #endif
  517.  
  518. #if PRAGMA_ALIGN_SUPPORTED
  519. #pragma options align=reset
  520. #endif
  521.  
  522. #ifdef __cplusplus
  523. }
  524. #endif
  525.  
  526. #endif /* __WINDOWS__ */
  527.